/*
 * @Author: your name
 * @Date: 2021-05-08 09:22:46
 * @LastEditTime: 2021-05-12 12:35:07
 * @LastEditors: Please set LastEditors
 * @Description: In User Settings Edit
 * @FilePath: \after-end\app\router.js
 */
"use strict";

/**
 * @param {Egg.Application} app - egg application
 */
module.exports = (app) => {
  const { router, controller } = app;

  router.get("/", controller.home.index);

  router.post("/api/register", controller.user.regisert); //后台管理用户注册

  router.post("/api/login", controller.user.login); //后台管理用户登录

  router.post("/newHouseList", controller.newHouse.newHouseList); //新房列表

  router.post("/newHouseAdd", controller.newHouse.newHouseAdd); //新房增加

  router.post("/newHouseDel", controller.newHouse.newHouseDel); //新房删除

  router.post("/newHouseSet", controller.newHouse.newHouseSet); //新房编辑

  router.post("/oldHouseList", controller.oldHouse.oldHouseList); //二手房列表

  router.post("/oldHouseAdd", controller.oldHouse.oldHouseAdd); //二手房增加

  router.post("/oldHouseDel", controller.oldHouse.oldHouseDel); //二手房删除

  router.get("/api/fandroutes", controller.routes.fandRoutes); //后台管理查找路由

  router.get("/api/addList", controller.routes.addList); //后台管理查找路由

  router.post("/oldHouseSet", controller.oldHouse.oldHouseSet); //二手房编辑

  router.post("/rentingList", controller.renting.rentingList); //租房列表

  router.post("/rentingAdd", controller.renting.rentingAdd); //租房增加

  router.post("/rentingDel", controller.renting.rentingDel); //租房删除

  router.post("/rentingSet", controller.renting.rentingSet); //租房编辑

  router.post('/api/updaterouter', controller.routes.updateRoutes);//后台修改管理用户列表

  router.get('/api/fandusertable', controller.user.fandUserTable); //后台管理用户列表
};
